<nz-tab>
    <ng-template #nzTabHeading>
        学校管理
    </ng-template>
    <div class="search-add-box">
        学校名称：
        <nz-input [nzPlaceHolder]="'请输入查询学校名称'" [(ngModel)]="searchValue" style="width: 200px;" [nzSize]="'large'"></nz-input>
        <button nz-button type="submit" class="mar-left" [nzType]="'primary'" [nzSize]="'large'" (click)="search()">查询
        </button>
        <button nz-button class="btn-right" [nzType]="'default'" [nzSize]="'large'" *ngIf="_checkTable.length > 0" (click)="allDelete()">
            <span>批量删除</span>
        </button>
        <button nz-button class="btn-right" (click)="modal('add', '')" [nzType]="'primary'" [nzSize]="'large'">
            <i class="anticon anticon-plus"></i>
            <span>新建</span>
        </button>
    </div>
    <nz-table #nzTable2 [nzDataSource]="data" [nzPageSize]="10" (nzDataChange)="_displayDataChange($event)" (nzPageIndexChange)="_refreshStatus()"
        (nzPageSizeChange)="_refreshStatus()" [nzLoading]="_loading">
        <thead nz-thead>
            <tr>
                <!--<th nz-th [nzCheckbox]="true">-->
                <!--<label nz-checkbox [(ngModel)]="_allChecked" [nzIndeterminate]="_indeterminate" (ngModelChange)="_checkAll($event)">-->
                <!--</label>-->
                <!--</th>-->
                <th nz-th>
                    <span>学校名称</span>
                </th>
                <th nz-th>
                    <span>所在城市</span>
                </th>
                <th nz-th>
                    <span>管理员账号</span>
                </th>
                <th nz-th>
                    <span>联系方式</span>
                </th>
                <th nz-th>
                    <span>操作</span>
                </th>
            </tr>
        </thead>
        <tbody nz-tbody>
            <tr nz-tbody-tr *ngFor="let data of nzTable2.data;let i = index">
                <!--<td nz-td [nzCheckbox]="true">-->
                <!--<label nz-checkbox [(ngModel)]="data.checked" (ngModelChange)="_refreshStatus($event)">-->
                <!--</label>-->
                <!--</td>-->
                <td nz-td>{{data.SchoolName}}</td>
                <td nz-td>{{data.City}}</td>
                <td nz-td>{{data.LoginName}}</td>
                <td nz-td>{{data.ContactWay}}</td>
                <td nz-td>
                    <span>

                        <a (click)="cloudProject(data)">关联项目</a>
                        <span nz-table-divider></span>
                        <a (click)="CrouseProject(data)">关联课程</a>
                        <span nz-table-divider></span>
                        <a (click)="info(contentTpl,data,Status[i])">查看</a>
                        <span nz-table-divider></span>
                        <a (click)="clock(data)">{{ data.IsUse==0 ? '锁定': '解锁'}} </a>
                        <span nz-table-divider></span>
                        <a (click)="modal ('update', data)">修改</a>
                        <span nz-table-divider></span>
                        <a (click)="showConfirm(data)">删除</a>

                    </span>
                </td>
            </tr>
        </tbody>
    </nz-table>

    <form nz-form [formGroup]="form">
        <nz-modal [nzWrapClassName]="'vertical-center-modal'" [nzVisible]="modalVisible2" [nzTitle]="popTitle" [nzConfirmLoading]="loading"
            [nzContent]="modalContent2" (nzOnCancel)="formreset($event)" (nzOnOk)="save()" [nzOkText]="'保存'" [nzCancelText]="'取消'">
            <ng-template #modalContent2>
                <div nz-form-item class="d-flex d-flex-margin">
                    <label for="xxName" nz-form-item-required>学 校 名 称</label>
                    <!--<div nz-form-label class="til-box">学 校 名 称 ：</div>-->
                    <div nz-form-control class="flex-1" nzHasFeedback [nzValidateStatus]="getFormControl('xxName')">
                        <nz-input formControlName="xxName" [(ngModel)]="Sname" name="xxName" [nzSize]="'large'" [nzPlaceHolder]="'请输入'" nzId="no"></nz-input>
                        <div nz-form-explain *ngIf="getFormControl('xxName').dirty&&getFormControl('xxName').hasError('required')">
                            请输入学校名称!
                        </div>
                    </div>
                </div>
                <div nz-form-item class="d-flex d-flex-margin">
                    <label nz-form-item-required>所 在 城 市</label>
                    <!--<div nz-form-label class="til-box">学 院 名 称 ：</div>-->
                    <div nz-form-control class="flex-1" style="width: 48%;margin-right:4%">
                        <nz-select formControlName="proName" name="proName" [(ngModel)]="Province" [nzSize]="'large'" [nzPlaceHolder]="'--请选择--'"
                            (ngModelChange)="proChange()">
                            <nz-option *ngFor="let pro of province" [nzLabel]="pro" [nzValue]="pro"></nz-option>
                        </nz-select>

                    </div>
                    <div nz-form-control class="flex-1" style="width: 48%">
                        <nz-select formControlName="cityName" name="cityName" [(ngModel)]="City" [(ngModel)]="City" [nzPlaceHolder]="'--请选择--'" [nzSize]="'large'">
                            <nz-option *ngFor="let cit of cityArr" [nzLabel]="cit" [nzValue]="cit"></nz-option>
                        </nz-select>
                        <!--<div nz-form-explain *ngIf="getFormControl('cityName').dirty&&getFormControl('cityName').hasError('required')">请输入学院名称!</div>-->
                    </div>
                </div>
                <div nz-form-item class="d-flex d-flex-margin">
                    <label for="glyName" nz-form-item-required>管理员账号</label>
                    <!--<div nz-form-label class="til-box">管理员账号：</div>-->
                    <div nz-form-control class="flex-1" nzHasFeedback [nzValidateStatus]="getFormControl('glyName')">
                        <nz-input formControlName="glyName" [(ngModel)]="Sgly" name="glyName" [nzSize]="'large'" [nzPlaceHolder]="'请输入'" nzId="no"></nz-input>
                        <div nz-form-explain *ngIf="getFormControl('glyName').dirty&&getFormControl('glyName').hasError('required')">
                            请输入管理员账号!
                        </div>
                        <!-- <nz-input-number [(ngModel)]="Sgly" [nzMin]="0" [nzMax]="10000" [nzStep]="1"></nz-input-number>-->
                    </div>
                </div>
                <div nz-form-item class="d-flex d-flex-margin">
                    <label for="pass" nz-form-item-required>管理员密码</label>
                    <!--<div nz-form-label class="til-box">管理员密码：</div>-->
                    <!--LoginPwd-->
                    <div nz-form-control class="flex-1" nzHasFeedback [nzValidateStatus]="getFormControl('pass')">
                        <nz-input formControlName="pass" [(ngModel)]="SglyPass" name="pass" [nzSize]="'large'" [nzPlaceHolder]="'请输入'" nzId="no"></nz-input>
                        <div nz-form-explain *ngIf="getFormControl('pass').dirty&&getFormControl('pass').hasError('required')">请输入管理员密码!
                        </div>
                        <!--  <nz-input-number [(ngModel)]="SglyPass" [nzMin]="0" [nzMax]="10000" [nzStep]="1"></nz-input-number>-->
                    </div>
                </div>
                <div nz-form-item class="d-flex d-flex-margin">
                    <label for="tel" nz-form-item-required>联 系 方 式</label>
                    <!--<div nz-form-label class="til-box">联 系 方 式 ：</div>-->
                    <div nz-form-control class="flex-1" nzHasFeedback [nzValidateStatus]="getFormControl('tel')">
                        <nz-input formControlName="tel" [(ngModel)]="Stel" name="tel" [nzSize]="'large'" [nzPlaceHolder]="'请输入'" nzId="no"></nz-input>
                        <!--<div nz-form-explain *ngIf="getFormControl('tel').dirty&&getFormControl('tel').hasError('required')">请输入联系方式!</div>-->
                        <div nz-form-explain *ngIf="getFormControl('tel').dirty&&getFormControl('tel').hasError('email')">邮箱格式不正确！
                        </div>
                        <!--  <nz-input-number [(ngModel)]="Stel" [nzMin]="0" [nzMax]="10000" [nzStep]="1"></nz-input-number>-->
                    </div>
                </div>
            </ng-template>
        </nz-modal>
    </form>
    <ng-template #contentTpl>
        <div nz-form-item class="d-flex d-flex-margin">
            <div nz-form-control class="flex-1">
                <div nz-form-label class="til-box">学校名称：</div>
                {{Sname}}
            </div>
        </div>
        <div nz-form-item class="d-flex d-flex-margin">
            <div nz-form-control class="flex-1">
                <div nz-form-label class="til-box">所在城市：</div>
                {{City}}
            </div>
        </div>
        <div nz-form-item class="d-flex d-flex-margin">
            <div nz-form-control class="flex-1">
                <div nz-form-label class="til-box">管理员账号：</div>
                {{Sgly}}
            </div>
        </div>
        <div nz-form-item nz-row>
            <div nz-form-control class="flex-1">
                <div nz-form-label class="til-box">联系方式：</div>
                {{Stel}}
            </div>
        </div>
    </ng-template>

    <nz-modal [nzWrapClassName]="'vertical-center-modal'" [nzFooter]="'true'" [nzVisible]="cloubModal" [nzTitle]="'查看云项目'" [nzConfirmLoading]="loading"
        [nzContent]="cloubContent" (nzOnCancel)="cloubModal=false" (nzOnOk)="SaveCloudSchool()" [nzStyle]="style" [nzOkText]="'确定'"
        [nzCancelText]="'取消'">
        <ng-template #cloubContent>

            <nz-table #nzTable [nzDataSource]="cloudList" [nzPageIndex]="1" [nzPageSize]="4" [nzTotal]="cloubTotal">
                <thead nz-thead>
                    <tr>
                        <th nz-th width="15%">
                            是否关联
                        </th>
                        <th nz-th width="25%">
                            项目名称
                        </th>
                        <th nz-th>
                            项目描述
                        </th>
                    </tr>
                </thead>
                <tbody nz-tbody>
                    <tr nz-tbody-tr *ngFor="let list of nzTable.data">
                        <td nz-td>
                            <label nz-checkbox [(ngModel)]="list.isCheck" (ngModelChange)="cloudChange($event,list.p_id)">
                            </label>
                        </td>
                        <td nz-td>
                            {{ list.p_name}}
                        </td>
                        <td nz-td>
                            {{list.p_description}}
                        </td>
                    </tr>
                </tbody>
            </nz-table>
        </ng-template>
    </nz-modal>

    <nz-modal [nzWrapClassName]="'vertical-center-modal'" [nzFooter]="'true'" [nzVisible]="CourseModal" [nzTitle]="'查看云课程'" [nzConfirmLoading]="loading"
        [nzContent]="cloubContent1" (nzOnCancel)="CourseModal=false" (nzOnOk)="SaveCourseSchool()" [nzStyle]="style" [nzOkText]="'确定'"
        [nzCancelText]="'取消'">
        <ng-template #cloubContent1>

            <nz-table #nzTable [nzDataSource]="courseList" [nzPageIndex]="1" [nzPageSize]="4" [nzTotal]="courseTotal">
                <thead nz-thead>
                    <tr>
                        <th nz-th width="15%">
                            是否关联
                        </th>
                        <th nz-th width="25%">
                            课程名称
                        </th>
                    </tr>
                </thead>
                <tbody nz-tbody>
                    <tr nz-tbody-tr *ngFor="let list of nzTable.data">
                        <td nz-td>
                            <label nz-checkbox [(ngModel)]="list.isCheck" (ngModelChange)="CourseChange($event,list.cour_id)">
                            </label>
                        </td>
                        <td nz-td>
                            {{ list.cour_name}}
                        </td>
                    </tr>
                </tbody>
            </nz-table>
        </ng-template>
    </nz-modal>

</nz-tab>
